import pymssql
server = '172.16.7.50'
username = 'WINDBA'
password = 'sql2K!^RCAW'
database='all60_rc'
with pymssql.connect(server, username, password, database) as conn:
    with conn.cursor() as cursor:
        cursor.execute('select @@version')
        for row in cursor.fetchall():
            print(row)